using System;
using System.Threading.Tasks;
using SheLife.Domain.Entities;

namespace SheLife.Domain.Interfaces.Repositories
{
    /// <summary>
    /// 社区帖子举报仓储接口
    /// </summary>
    public interface ICommunityPostReportRepository : IRepository<CommunityPostReport>
    {
        /// <summary>
        /// 根据用户ID获取举报列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>举报列表</returns>
        Task<IEnumerable<CommunityPostReport>> GetByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据帖子ID获取举报列表
        /// </summary>
        /// <param name="postId">帖子ID</param>
        /// <returns>举报列表</returns>
        Task<IEnumerable<CommunityPostReport>> GetByPostIdAsync(Guid postId);

        /// <summary>
        /// 根据状态获取举报列表
        /// </summary>
        /// <param name="status">状态</param>
        /// <returns>举报列表</returns>
        Task<IEnumerable<CommunityPostReport>> GetByStatusAsync(string status);

        /// <summary>
        /// 根据举报类型获取举报列表
        /// </summary>
        /// <param name="reportType">举报类型</param>
        /// <returns>举报列表</returns>
        Task<IEnumerable<CommunityPostReport>> GetByReportTypeAsync(string reportType);

        /// <summary>
        /// 检查用户是否已举报帖子
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="postId">帖子ID</param>
        /// <returns>是否已举报</returns>
        Task<bool> CheckUserHasReportedAsync(Guid userId, Guid postId);

        /// <summary>
        /// 获取帖子的举报数量
        /// </summary>
        /// <param name="postId">帖子ID</param>
        /// <returns>举报数量</returns>
        Task<int> GetPostReportCountAsync(Guid postId);

        /// <summary>
        /// 获取待处理的举报列表（分页）
        /// </summary>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <returns>待处理的举报列表</returns>
        Task<(IEnumerable<CommunityPostReport> Items, int TotalCount)> GetPendingReportsPagedAsync(int pageIndex, int pageSize);

        /// <summary>
        /// 更新举报状态
        /// </summary>
        /// <param name="reportId">举报ID</param>
        /// <param name="status">状态</param>
        /// <param name="handledBy">处理人ID</param>
        /// <param name="remark">备注</param>
        /// <returns>是否成功</returns>
        Task<bool> UpdateReportStatusAsync(Guid reportId, string status, Guid handledBy, string remark);
    }
}